UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GkgQXmeTBT8np+u9B1qgq/QS6g1bCY2vyrPArv+M6s4='
WHERE
key_id = 'c0e5f26b1c1e0e7cb3d368dbf3989de9b59fcb2ce9ffe10e6382c5142a47df67'
AND (
token = 'GkgQXmeTBT8np+u9B1qgq/QS6g1bCY2vyrPArv+M6s4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)