UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mt5U1cXRHruPYgrGLiha9VscW/rzimt7VNR1kVEo4qs=' 
WHERE 
  key_id = '9b95225a3c106f6710e5e1b53ac347dd18374be621a8b6caa133f9f7bf4428a2' 
  AND (
    token = 'mt5U1cXRHruPYgrGLiha9VscW/rzimt7VNR1kVEo4qs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051