UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I+bJoJ+QwMoMjdRswjq6yWCbnr/DRQFcMiQVskphkm8='
WHERE
key_id = 'e1aae5e67a4c892edd1f2f14ffaf1d94b88efca5a4838776ee3a50fd9c0f0a91'
AND (
token = 'I+bJoJ+QwMoMjdRswjq6yWCbnr/DRQFcMiQVskphkm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)