UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't/h0KYYKU1DCcec9UsWD4b4r4eVe33Oby7vX1P8MCCI='
WHERE
key_id = 'e8a25ac747af0e4dbfe1e978b09aabdf5ab63bde26cd2e72a78bc2ed5f78fa1a'
AND (
token = 't/h0KYYKU1DCcec9UsWD4b4r4eVe33Oby7vX1P8MCCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)