UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e4o9g2/DpYlesb5FstRR9T3LrXvmYIby9wTo0vc/hFQ='
WHERE
key_id = 'a82c2c8db6622c01ab885f398c24e63fdb38bffd1291f408db9b60dfd273ad4b'
AND (
token = 'e4o9g2/DpYlesb5FstRR9T3LrXvmYIby9wTo0vc/hFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)