UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ShVN7H1TIuEJs7CKo9YvbZ9eoENmeNaDXUokr1Jqiwc=' 
WHERE 
  key_id = 'f92885379a1b8f49eb1080daccfe8ed66b6ee615151fb896e56b664eaa0bee1f' 
  AND (
    token = 'ShVN7H1TIuEJs7CKo9YvbZ9eoENmeNaDXUokr1Jqiwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036