UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2PWM2/6INf6b6pZch9IbedKHq2kL5OuFfDMTlfMs8Zw='
WHERE
key_id = 'fbc572767818a03f10eeacf2da1f312dfa11452635263807f6ede72f7c753a1e'
AND (
token = '2PWM2/6INf6b6pZch9IbedKHq2kL5OuFfDMTlfMs8Zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)