UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4rvcYD1id2UWJRg3VGaSd5aamGIemzP3V01cQOmODw='
WHERE
key_id = '2c57c8fb41134f5465cae4490b82c0f2a2d0f0565b9004457439a5fdf3f6b026'
AND (
token = 's4rvcYD1id2UWJRg3VGaSd5aamGIemzP3V01cQOmODw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)