UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uPpTfaPYzVKkxATYBWXy2LPZnNXMnFLElZkw0i3YbeA='
WHERE
key_id = '5c68b93fe024827a9cbfec64ccd7e6d0890514597574b9d5daaa138eff589370'
AND (
token = 'uPpTfaPYzVKkxATYBWXy2LPZnNXMnFLElZkw0i3YbeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)