UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NiONwjKGWqSkiDfpw7LvEKe0s+dNDmuPtiEoqfag0Eg='
WHERE
key_id = '627d71c533b2baa3196f8caa3fa8b36d5ae0d924fdb3245add123b27283d5c15'
AND (
token = 'NiONwjKGWqSkiDfpw7LvEKe0s+dNDmuPtiEoqfag0Eg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)