UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WhSmDRyTIS0GgmHgOzlihF1oZUdyxOF+Xj231+ro5w0=' 
WHERE 
  key_id = '3b469c60d19d52341d2fc65dd34c37a6cb5efe4867558d8fa00747ca092b8117' 
  AND (
    token = 'WhSmDRyTIS0GgmHgOzlihF1oZUdyxOF+Xj231+ro5w0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021