UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rKpvrHD6+WrpIeM0VS0QIqgEIjCCLRXhhwSLyF2jBW8='
WHERE
key_id = 'b73e56888eedc44e972b7fce554271d2c08a5a7b40a0c2e6a834dfefb6954fc8'
AND (
token = 'rKpvrHD6+WrpIeM0VS0QIqgEIjCCLRXhhwSLyF2jBW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)