UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vKuctUxgWKPTbnHAChlvKU2S3KH85yVbCE9/DE3WNl4=' 
WHERE 
  key_id = 'b1801514d73d79fe88455da184245b0bdb7cdc96c8c26ed36ab432c915071c96' 
  AND (
    token = 'vKuctUxgWKPTbnHAChlvKU2S3KH85yVbCE9/DE3WNl4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031