UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R53poTDU8/mtT6ppNYOnh8FpB+i2HHQNACeiDh2adXE='
WHERE
key_id = 'fa90ba0487193bae66621acd7eebd1f726e5a85b037b1a5da08578ca4ed63d8f'
AND (
token = 'R53poTDU8/mtT6ppNYOnh8FpB+i2HHQNACeiDh2adXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)