UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dHWIoZ72xnUBkO+1urM6MjoLggWn1xiuuzc8i6s5AQA='
WHERE
key_id = '046b1a1d02208d04e7afb392b06d41f32e440a6dc081f936d8a15fa509ab1bbc'
AND (
token = 'dHWIoZ72xnUBkO+1urM6MjoLggWn1xiuuzc8i6s5AQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)