UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0IOK4YZtWHA2QwKnyaso5qDniPvr2EmZgtpDbqsRvzE='
WHERE
key_id = '0d6682318f51df405a62ceccb972f5a7c0da5b2f22c08373b3114631bbf8c3a1'
AND (
token = '0IOK4YZtWHA2QwKnyaso5qDniPvr2EmZgtpDbqsRvzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)