UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vpYXdvdWeZDDPJ9+fFL0kLSOXW4zLtpkP37tj380+2A='
WHERE
key_id = '0d1c17926c2beb95ea2e18e0ca987c1b1dce23052a2f175af5db29176f9c24b4'
AND (
token = 'vpYXdvdWeZDDPJ9+fFL0kLSOXW4zLtpkP37tj380+2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)