UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q1LXtKm4C8E8xZddeNxByS37IsXTlu/i+8EHDgHDBUE='
WHERE
key_id = 'a2b8d2e90ffb96216f625fec5529964702e4686b19396541a26bd4e70f6d3a44'
AND (
token = 'Q1LXtKm4C8E8xZddeNxByS37IsXTlu/i+8EHDgHDBUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)