UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hRxCUuAQbpQKlU+yZtKuqZ7khE4YglDS0ZtMp6tvCQ4='
WHERE
key_id = 'b458ab1159edd96568d08e45bba56d3746b1b0bafd2190a2521ba1cbecb1ec0e'
AND (
token = 'hRxCUuAQbpQKlU+yZtKuqZ7khE4YglDS0ZtMp6tvCQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)