UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3vokJtDz6HWTxMdv1UUby0yBwwKBojW9sHt2tACak5k='
WHERE
key_id = '9f3c5128f0f57d735ac3a45f87d348e65bb346362f69d0dd0941c2a3dca5c803'
AND (
token = '3vokJtDz6HWTxMdv1UUby0yBwwKBojW9sHt2tACak5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)