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

Query time 0.00034