UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TBIyQF5xRCUFeNhwDXHiTWwHB7H6x17jX2+tLN70mq0='
WHERE
key_id = 'a0db97a5b5b412b21a50ccab99cf57ae9729273ccbb9cdc5a3cc2d88b0e0c39c'
AND (
token = 'TBIyQF5xRCUFeNhwDXHiTWwHB7H6x17jX2+tLN70mq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)