UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pJNpMa3uw9OZYPVatNPK1nZHu7TBS+pWDv8OnYipYO4=' 
WHERE 
  key_id = 'ee76236a378a3aea94ff75e73c1268f1bb701c8fb8a046e0333c9af1f57e227c' 
  AND (
    token = 'pJNpMa3uw9OZYPVatNPK1nZHu7TBS+pWDv8OnYipYO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059