UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yOpFj0ED7Fm6bsKd7FljgK3YZqWso2YAW+g71jDb5f8=' 
WHERE 
  key_id = 'c32d12cc88ace73d027c230fa56525c153759ab0c539fd70b1aac48f2b7cc5b2' 
  AND (
    token = 'yOpFj0ED7Fm6bsKd7FljgK3YZqWso2YAW+g71jDb5f8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025