UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jMjiJV4CxWgYDghcOnyXAJwwUwTXC170Ys4+DKsTEwU=' 
WHERE 
  key_id = '278ed598c052f1e9a39e8c91ba849e75ea6669675115b1a532b3c628e4d93d00' 
  AND (
    token = 'jMjiJV4CxWgYDghcOnyXAJwwUwTXC170Ys4+DKsTEwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033