UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EkTQltMqZ4LRcSnEKz3K8M9oGCKB83lFmf/M6lkw5o8='
WHERE
key_id = '30f527c9fcc15e5874c99f37ac0f6618e6f6fbbe4d00ca28d4aab31efc488579'
AND (
token = 'EkTQltMqZ4LRcSnEKz3K8M9oGCKB83lFmf/M6lkw5o8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)