UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '50WsN0zmJ0bxJqBgh+hJZhDGH5zCgLMtxL9LWpcnj84=' 
WHERE 
  key_id = '98cdaadbea62ac6b4108b592612611a920be67756ed0b1e259f77d708d2a8e38' 
  AND (
    token = '50WsN0zmJ0bxJqBgh+hJZhDGH5zCgLMtxL9LWpcnj84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045