UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q9wC8eTejPR0fgs0hMSZTQOQqvrYpLPXsBR3j5gg3cE='
WHERE
key_id = '302e15f0fcfd34720c1d96d8199a2b5d81098faf73fafc9e89c25f00ec00f75b'
AND (
token = 'Q9wC8eTejPR0fgs0hMSZTQOQqvrYpLPXsBR3j5gg3cE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)