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