UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E0PIt6V1b607iWKtm2lXvrCpwDTzgpsFhPvMg4BtGwo='
WHERE
key_id = '66e21abae14c8d3f7f0cb844b366cff1b6e4ce5c2c73e07315aa2568d8491f8f'
AND (
token = 'E0PIt6V1b607iWKtm2lXvrCpwDTzgpsFhPvMg4BtGwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)