UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uwZq+QfzIVDflnXMSStyTeVjDzAhAxJOBhTJy0yCqAA='
WHERE
key_id = '8c41b3a8219f65f68a1f94f2d2052425877f359d8d11b7e2b15ca75ae99994e6'
AND (
token = 'uwZq+QfzIVDflnXMSStyTeVjDzAhAxJOBhTJy0yCqAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)