UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RnplNT8drxcu9LgnWyatc0i6k9G1EUEc7gGsOQ3517I='
WHERE
key_id = 'd67989233a9c7de44ce9d5fbaf0abb28028b62cac9d50c616d8bd6968d346e80'
AND (
token = 'RnplNT8drxcu9LgnWyatc0i6k9G1EUEc7gGsOQ3517I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)