UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n7Jp/l92F17vAIj6lXPxugFICL5SLzjVFIb9FiesypA='
WHERE
key_id = '0bf1583f74478af245536cfc26b7c1e9b57ab237e53118e622913dc2913572f4'
AND (
token = 'n7Jp/l92F17vAIj6lXPxugFICL5SLzjVFIb9FiesypA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)