UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UIZMwUHDMSIIYORpFZBQGLpTHkyEALdfyH41n9BAw7o='
WHERE
key_id = '38000d94047a511580340454f81304c1495165fec01c00682c173f33982801ee'
AND (
token = 'UIZMwUHDMSIIYORpFZBQGLpTHkyEALdfyH41n9BAw7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)