UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oKcgymaLq1nww/dVgUAsOfSVwCutSmbwuTCdhDMf5os='
WHERE
key_id = 'b0a78caff67d98c8a01dc4b008c18fc13aee823c4001e6e8af68bdafba76f46c'
AND (
token = 'oKcgymaLq1nww/dVgUAsOfSVwCutSmbwuTCdhDMf5os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)