UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Crgpprpy9T+hzc2YmWf+o3/qYe4prqr/6FNdy2YKHL0='
WHERE
key_id = '20d3a7b0788fb46adc1cd639b6d5e8adc863f141ba0f910df979fbf261cd0d1e'
AND (
token = 'Crgpprpy9T+hzc2YmWf+o3/qYe4prqr/6FNdy2YKHL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)